import React from 'react';
import './index.less';
import {render} from 'ader';
import LeftContent from './components/Left';
import ContentShow from './components/Content';
import PageAction from '@/actions/page.js';
import {Drawer, Button} from 'antd';
import StyleSetting from './components/StyleForm';


export default render({
    actions: {
        pageAct: PageAction
    },
    models: ['home']
})(({props, state, action}) => {
    const {home} = props;

    return (
        <div className="page-designer">
            <div className="page-d-layout">
                <div className="page-d-header">
                    <Button
                        onClick={action.pageAct.printConfig}
                        type="primary"
                    >
                        控制台输出配置文件
                    </Button>
                </div>
                <div className="page-d-body">
                    <div
                        className="page-d-left-side"
                    >
                        <LeftContent />
                    </div>
                    <div
                        className="page-d-right-content"
                    >
                        <ContentShow />
                    </div>
                </div>
            </div>
            <Drawer
                title="样式设置"
                placement="right"
                visible={home.styleSettingVisible}
                onClose={action.pageAct.closeStyleSetting}
                width={800}
            >
                <StyleSetting />
            </Drawer>
        </div>
    );
})